import 'dart:convert';

PaymentUserInfo paymentUserInfoFromJson(String str) =>
    PaymentUserInfo.fromJson(json.decode(str));

String paymentUserInfoToJson(PaymentUserInfo data) =>
    json.encode(data.toJson());

class PaymentUserInfo {
  PaymentUserInfo({
    this.firstName,
    this.lastName,
    this.email,
    //this.confirmEmail,
    this.userName,
    //this.phone,
    this.password,
    //this.confirmPassword,
    //this.teacherEmail,
    this.customerId,
    this.extendFlag,
    //this.quoteNumber,
    this.braintreeCustomerId,
    this.phoneNumber,
    this.subscription,
    //this.firstStep,
    this.dateOfBirth,
    this.street,
    this.city,
    this.state,
    this.country,
    this.gender,
    this.level,
    this.trial,
    // this.language,
    // this.lang,
    // this.pinyin,
    this.settings,
  });

  String? firstName;
  String? lastName;
  String? email;
  //String? confirmEmail;
  String? userName;
  String? phone;
  String? password;
  //String? teacherEmail;
  //String? confirmPassword;
  String? customerId;
  bool? extendFlag;
  //String? quoteNumber;
  String? braintreeCustomerId;
  String? phoneNumber;
  String? subscription;
  bool? firstStep;
  String? dateOfBirth;
  String? street;
  String? city;
  String? state;
  String? country;
  String? gender;
  String? level;
  // String? language;
  // String? lang;
  // bool? pinyin;
  Settings? settings;
  bool? trial;

  factory PaymentUserInfo.fromJson(Map<String, dynamic> json) =>
      PaymentUserInfo(
          firstName: json["firstName"],
          lastName: json["lastName"],
          email: json["email"],
          //confirmEmail: json["confirmEmail"],
          userName: json["userName"],
          //phone: json["phone"],
          password: json["password"],
          //teacherEmail: json["teacherEMail"],
          //confirmPassword: json["confirmPassword"],
          customerId: json["customerId"],
          extendFlag: json["extendFlag"],
          //quoteNumber: json["quoteNumber"],
          braintreeCustomerId: json["braintreeCustomerId"],
          phoneNumber: json["phoneNumber"],
          //subscription: json["subscription"],
          //firstStep: json["firstStep"],
          settings: json["settings"] != null
              ? Settings.fromJson(
                  json["settings"],
                )
              : null,
          level: json["level"],
          dateOfBirth: json['dateOfBirth'],
          street: json['street'],
          state: json['state'],
          city: json['city'],
          country: json['country'],
          gender: json['gender'],
          trial: json['trial']);

  Map<String, dynamic> toJson() => {
        "firstName": firstName,
        "lastName": lastName,
        "email": email,
        //'confirmEmail': confirmEmail,
        "userName": userName,
        //"phone": phone,
        "password": password,
        //"teacherEmail": teacherEmail,
        //"confirmPassword": confirmPassword,
        "customerId": customerId,
        "entendFlag": extendFlag,
        //"quoteNumber": quoteNumber,
        "braintreeCustomerId": braintreeCustomerId,
        "phoneNumber": phoneNumber,
        "subscription": subscription,
        //"firstStep": firstStep,
        "settings": settings != null ? settings?.toJson() : null,
        'level': level,
        'dateOfBirth': dateOfBirth,
        'street': street,
        'state': state,
        'city': city,
        'country': country,
        'gender': gender,
        'trial': trial,
        // 'language': language,
        // 'lang': lang,
        // 'pinyin': pinyin
      };
}

class Settings {
  Settings({
    this.dictionary,
    this.lang,
    this.language,
    this.pinyin,
  });
  bool? dictionary;
  String? lang;
  String? language;
  bool? pinyin;

  factory Settings.fromJson(Map<String, dynamic> json) => Settings(
      dictionary: json["dictionary"],
      lang: json["lang"],
      language: json["language"],
      pinyin: json["pinyin"]);

  Map<String, dynamic> toJson() => {
        "dictionary": dictionary,
        "lang": lang,
        "language": language,
        "pinyin": pinyin,
      };
}
